package com.example.entity;

import java.security.Timestamp;

public class User {
    private Integer id;
    private String username;
    private String password;
    private String role; // "student", "teacher", "admin"

    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    private Timestamp createdAt; // 可选

    // 无参构造、Getter和Setter
    public User() {}

    // 全参构造（可选）
    public User(String username, String password, String role) {
        this.username = username;
        this.password = password;
        this.role = role;
    }

    // Getters and Setters（省略具体代码）
    // 注意：字段名必须与数据库列名一致（或通过@Column注解映射）
}